# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from fastapi import Query
from pydantic import BaseModel, Field


class PaymentDetailIn(BaseModel):
    """ 支付配置详情参数 """
    id: int = Query(..., gt=0, description="支付配置ID")


"""--------------- Separator ---------------"""


class PaymentListVo(BaseModel):
    """ 支付配置列表Vo """
    id: int = Field(description="ID")
    channel: int = Field(description="渠道别名")
    shorter: str = Field(description="简写名称")
    logo: str = Field(description="渠道图标")
    icon: str = Field(description="支付图标")
    sort: int = Field(description="排序编号")
    status: int = Field(ge=0, le=1, description="渠道状态: [0=禁用, 1=启用]")

    class Config:
        json_schema_extra = {
            "example": {
                "id": 1,
                "channel": 2,
                "shorter": "微信支付",
                "name": "微信支付",
                "logo": "https://www.xx.com/wx.png",
                "icon": "https://www.xx.com/wx.png",
                "status": 1
            }
        }


class PaymentDetailVo(BaseModel):
    """ 支付配置详情Vo """
    id: int = Field(description="ID")
    channel: int = Field(description="渠道别名")
    shorter: str = Field(description="简写名称")
    name: str = Field(description="渠道名称")
    icon: str = Field(description="支付图标")
    sort: int = Field(description="排序编号")
    status: int = Field(ge=0, le=1, description="渠道状态: [0=禁用, 1=启用]")
    params: dict = Field(default={}, description="支付配置")

    class Config:
        json_schema_extra = {
            "example": {
                "channel": 2,
                "shorter": "微信支付",
                "name": "微信支付",
                "logo": "https://www.xx.com/wx.png",
                "icon": "https://www.xx.com/wx.png",
                "status": 1,
                "params": {}
            }
        }

